<?php
namespace App\Common;


class ErrorDefine
{

	const INVALID_TOKEN						= 10001;
	const DATA_DECODE_FAILED				= 10002;
	const SHORT_OF_UTYPE					= 10003;
	const SHORT_OF_PASSWORD					= 10004;
	const ILLEGAL_PASSWORD					= 10005;
	const REGISTER_FAILED					= 10006;
	const UPDATE_TABLE_FAILED     			= 10007;
	const PASSWORD_NOT_CORRECT				= 10008;
	const USER_NOT_EXIST					= 10009;
	const NAME_NOT_EXIST		    		= 10010;
	const SHORT_OF_ACCOUNT		    		= 10011;
	const ACCOUNT_IS_EXIST		    		= 10012;
	const ACCOUNT_NOT_EXIST		    		= 10013;
	const EMPTY_POST_DATA		    		= 10014;
	const DATABASE_ERROR		    		= 10015;
	const DATE_NOT_EXIST		    		= 10016;
	const USER_TYPE_NO_EXIST		    	= 10038;
	const CONCENT_NOT_EXIST		    		= 10017;
	const USER_IS_EXIST		    			= 10018;
	const TOKEN_NOT_EXIST		    	    = 10019;
	const TOKEN_IS_EXPIRERD		    	    = 10020;
	const ACCOUNT_OR_PASSOERD_DIE		    = 10021;
	const ACCOUNT_ID_NOT_EXIST		        = 10022;
	const UPDATE_ACCOUNT_INFO_ONE_FALSE		= 10023;
	const UPDATE_ACCOUNT_INFO_TWO_FALSE		= 10024;
	const UPDATE_ACCOUNT_GROUP_FALSE		= 10025;
	const PEICE_NOT_EXIST					= 10026;
	const BALANCE_NOT_ENGOUTH				= 10027;
	const ORDER_NO_NOT_EXIST			    = 10028;
	const ILLEGAL_CONNECT_NUM			    = 10029;
	const DATE_TYPE_NOT_EXIST			    = 10030;
	const ACCOUNT_TYPE_ONT_EXIST			= 10031;
	const INVALID_DATE						= 10032;
	const UP_LINE_NOT_EXIST					= 10033;
	const NEXT_LINE_NOT_EXIST				= 10034;
	const SPEED_NOT_EXIST					= 10035;
	const INVALID_PRICE						= 10036;
	const QQ_NOT_EXIST						= 10037;
	const PERMISSION_DENIED 				= 10039;
	const INVALID_MONEY 					= 10040;
	const INVALID_ACCOUNT 					= 10041;
	const INVALID_POSSWORD 					= 10042;
	const INVALID_PRIMARY 			    	= 10043;
	const INVALID_MIDDLE 			    	= 10044;
	const INVALID_HEIGHT 			    	= 10045;
	const INVALID_ADMIN_TYPE 			    = 10046;
	const ONLINETEAM_EXIST 			    	= 10047;



	static $arrErrorMessage = array(
			self::DATABASE_ERROR					=> '数据库错误',
			self::EMPTY_POST_DATA					=> 'Post数据为空',
			self::INVALID_TOKEN						=> '账号在其他地方登录，请重新登录！',
			self::DATA_DECODE_FAILED			    => 'Post数据解析失败',
			self::SHORT_OF_UTYPE					=> '缺少utype字段',

			self::SHORT_OF_PASSWORD					=> '缺少password字段',
			self::ILLEGAL_PASSWORD					=> '非法的密码',
			self::REGISTER_FAILED					=> '注册失败',
			self::UPDATE_TABLE_FAILED				=> '更新数据表失败',
			self::PASSWORD_NOT_CORRECT				=> '密码不正确',
			self::USER_NOT_EXIST					=> '用户不存在',

			self::NAME_NOT_EXIST					=>'用户名不能为空！',
			self::SHORT_OF_ACCOUNT					=>'账号不可以为空!',
			self::ACCOUNT_IS_EXIST					=>'账号已存在',
			self::ACCOUNT_NOT_EXIST					=>'账号不存在',
			self::DATE_NOT_EXIST					=>'过期时间不存在',
			self::CONCENT_NOT_EXIST					=>'连接数不存在',
			self::USER_IS_EXIST						=>'用户已存在',
			self::TOKEN_NOT_EXIST					=>'token 不存在',
			self::TOKEN_IS_EXPIRERD					=>'您的账号过期。请从新登陆',
			self::ACCOUNT_OR_PASSOERD_DIE		    =>'账号或密码不对，请从新登陆',
			self::ACCOUNT_ID_NOT_EXIST		        =>'账号ID不存在',
			self::UPDATE_ACCOUNT_INFO_ONE_FALSE		=>'更新账号信息1失败',
			self::UPDATE_ACCOUNT_INFO_TWO_FALSE		=>'更新账号信息2失败',
			self::UPDATE_ACCOUNT_GROUP_FALSE		=>'更新账号所属组失败',
			self::PEICE_NOT_EXIST					=>'价格不存在',
			self::BALANCE_NOT_ENGOUTH			    =>'余额不足，请充值',
			self::ORDER_NO_NOT_EXIST			    =>'订单号不存在',
			self::ILLEGAL_CONNECT_NUM			    =>'非法的连接数',
			self::DATE_TYPE_NOT_EXIST			    =>'日期类型不存在',
			self::ACCOUNT_TYPE_ONT_EXIST			=>'账号类型未选择',
			self::INVALID_DATE						=>'付费天数非法',
			self::UP_LINE_NOT_EXIST					=>'上行不存在',
			self::NEXT_LINE_NOT_EXIST				=>'下行不存在',
			self::SPEED_NOT_EXIST					=>'速度不存在',
			self::INVALID_PRICE						=>'非法的价格',
			self::QQ_NOT_EXIST						=>'QQ不存在',
			self::PERMISSION_DENIED					=>'没有权限执行此操作',
			self::INVALID_MONEY						=>'无效的金额',
			self::INVALID_ACCOUNT					=>'非法的账号',
			self::INVALID_POSSWORD					=>'非法的密码',
			self::INVALID_PRIMARY					=>'无效的基础套餐',
			self::INVALID_MIDDLE					=>'无效的中级套餐',
			self::INVALID_HEIGHT					=>'无效的高级套餐',
			self::INVALID_ADMIN_TYPE				=>'无效的管理员类型',
			self::ONLINETEAM_EXIST					=>'客服QQ已存在',

	);



	static function errorMessage($errorCode)
	{
		if(isset(self::$arrErrorMessage[$errorCode])) {
			return self::$arrErrorMessage[$errorCode];
		} else {
			return "未知错误码";
		}
	}
}

?>
